﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PLAYXPERT.Windows;

namespace SkypePXP
{
    public partial class AddPeople : PXPForm
    {

        //public List<string> SelectedUsers = new List<string>();
        BackLib.SkypeWrapper skypeWrapper;
        DataGridView dataGridView;
        public SKYPE4COMLib.UserCollection users;


        public AddPeople(BackLib.SkypeWrapper skypeWrapper)
        {
            InitializeComponent();
            this.skypeWrapper = skypeWrapper;
        }

        public void StartShow(DataGridView dataGridView)
        {
            this.dataGridView = dataGridView;
            panel1.Controls.Add(dataGridView);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            users = new SKYPE4COMLib.UserCollection();
            foreach(DataGridViewRow row in dataGridView.SelectedRows)
            {
                users.Add(skypeWrapper.UserFromHandle(row.Tag.ToString()));
            } 
            
            DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
    }
}
